<html>
    <head>
        <meta charset="UTF-8">
        <title>Acesso Restrito</title>
        <meta name="viewport" content="width=device-width">
        <link rel="stylesheet" type="text/css" href="../bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="../bootstrap/css/signin.css">
        <link rel="stylesheet" type="text/css" href="../bootstrap/css/padrao.css">
        <style>
            .modal-footer {   border-top: 0px; }
        </style>
    </head>
    <body >
        <div id="loginModal" class="modal show arealogin" tabindex="-1" role="dialog" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <div class="col-md-offset-5">
                            <img class="bg img-responsive" src="../imagens/cadeado.png" alt="" />
                        </div>
                    </div>
                    <div class="modal-body">
                        <form method="POST" action="verificar.php" class="form col-md-12 center-block" onsubmit="return valida_form(this)">
                            <div class="form-group">
                                <input type="text" required name="login" id="login" class="form-control input-lg" placeholder="Login">
                            </div>
                            <div class="form-group">
                                <input type="password" required name="senha" id="senha" class="form-control input-lg" placeholder="Senha">
                            </div>
                            <div class="form-group">
                                <button class="btn btn-primary btn-lg btn-block">Entrar</button>
                            </div>
                        </form>
                    </div>
                    <div class="modal-footer">
                        <div class="col-md-12">
                            <?php
                            if (isset($_GET['msg']) && $_GET['msg'] == 1) {
                                ?>
                                <div class="alert alert-danger text-center">Login e ou senha inválidos!</div>
                                <?php
                            }
                            ?>
                        </div>	
                    </div>
                </div>
            </div>
        </div>
        <script type="text/javascript" language="javascript">
            function valida_form() {
                if (document.getElementById("login").value.length < 1) {
                    alert('Campo login obrigatório!');
                    document.getElementById("login").focus();
                    return false;
                }
                if (document.getElementById("senha").value.length < 1) {
                    alert('Campo senha obrigatório!');
                    document.getElementById("senha").focus();
                    return false;
                }
            }
        </script>
    </body>
</html>
